![]() |
SNAP - 04: Duplicating, Tips, Sharing and Other Basics OPENING QUESTIONS: Although we *can* have multiple parts of a program running separately at the same time in SNAP, that is usually not good programming practice. Why is that? OBJECTIVE: I will be able to write a SNAP program to draw different shapes by duplicating sections of existing code during today's class WORD FOR TODAY: TIPS O' THE DAY: 1) ALWAYS have a 'clear' button ( 2) You can also 'delete' a script by dragging it off the scripting area 3) If you know the name of a block but can't remember where it is, use the ALWAYS helpful ctrl-F key (that works on website's AND pdf documents by the way) 4) How can you *duplicate* a script or part of a script (this will be VERY helpful in today's lab) 5) Always a good idea to have an x 'go to 0' and a y 'go to 0' to re-center your sprite if it get's lost 6) Right Mouse click on the stage and select 'show all' to bring sprite(s) back WORK O' THE DAY: Before we get started for today let me demo how to SHARE a program (It isn't all that obvious):
Let's get some volunteers to show their work today! I had some problems with my duplicating program yesterday -- those are fixed (yay!) Let's go to Snap and take a look at those now.
Please create a new program that creates a square (be sure to include the clear and other commands to 'reset' your program each time it runs. We discussed how we can copy and paste (duplicate!) sections blocks. We also talked about how we can use that to our advantage by taking the number of sides of a shape (4) dividing that into 360 to get the angle of each side (90o) Please use the duplicate command to create three additional shapes of up to 20 sides -- you can choose two of those but please make sure you do one for 20 sides (icosagon -- I just learned that this morning!) Our goal, aside from learning how cool the duplicate function works, is to learn how to put all of that code into one program. If you finish early please take a look at how to do a BRANCH HERE and if you are feeling burly copy and paste your code into this one |